class Rect {
  num height;
  num width;

  Rect(this.height, this.width);

  // num area() {
  //   return this.height * this.width;
  // }

  get area {
    return this.height * this.width;
  }

  set areaHeight(val) {
    this.height = val;
  }

}

void main() {
  Rect r = new Rect(5, 4);
  print("面积:${r.area}"); //注意：调用的时候直接通过访问属性的方式访问area

  r.areaHeight = 2;
  print("面积:${r.area}");

}